#include <iostream>
using namespace std;

int month_28[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int month_29[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int headM[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int headM_29[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int day_13[] = {0, 0, 0, 0, 0, 0, 0};

bool isLeap(int year)
{
    return (year % 400 == 0) || (year % 100 != 0 && year % 4 == 0);
}

void QianZhuiHe()
{
    for (int i = 1; i <= 11; i++)
    {
        headM[i] = month_28[i - 1] + headM[i - 1];
        headM_29[i] = month_29[i - 1] + headM_29[i - 1];
    }
}
int Up(int year, int days)
{
    int day = 0;
    for (int i = 1900; i < year; i++)
    {
        day += (isLeap(i) ? 366 : 365);
    }
    day = day + 1 + days;
    day = (day % 7 + 7) % 7;
    if (day == 0)
        day = 7;
    //cout << day;
    return day;
}

void is13(int year, bool flag)
{
    int day;
    int week = Up(year, day);
    for (int i = 0; i <= 11; i++)
    {
        day = flag ? (headM_29[i] + 13) : (headM[i] + 13);
        week = Up(year, day);
        day_13[week - 1] += 1;
    }
}
int main()
{
    QianZhuiHe();
    int year = 1900;
    int n = 0;
    cin >> n;
    for (int i = 1900; i < 1900 + n; i++)
    {
        is13(i, isLeap(i));
    }
    cout << day_13[6];
    for (int i = 0; i < 6; i++)
    {
        cout << " " << day_13[i];
    }
    return 0;
}